/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package todotask.Adapters;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JDialog;
import javax.swing.JFrame;
import todotask.entities.Task;
import todotask.view.TaskProperties;

/**
 *
 * @author dakota
 */
public class ViewPropertiesMouseListener extends MouseAdapter {

    private JFrame parent;
    private Task t;

    public ViewPropertiesMouseListener(JFrame parent, Task t) {
        this.parent = parent;
        this.t = t;
    }

    @Override
    public void mouseClicked(MouseEvent me) {
        JDialog viewTask = new JDialog(parent, "Tarea", true);
        viewTask.add(new TaskProperties(t, viewTask));
        viewTask.pack();
        viewTask.setLocationRelativeTo(parent);
        viewTask.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
        viewTask.setVisible(true);
    }
}
